			var uml = Joint.dia.uml;
            var Element = Joint.dia.Element;
            var point = Joint.point;
            
            
            /**
             * UML Use Cases Actor
             * @param raphael raphael paper
             * @param p point position
             * @param r radius
             * @param attrs shape SVG attributes
             */
            uml.Actor = Element.extend({
				
                init: function(properties){
                    // options
                    this.position = properties.position || point(0, 0);
                    this.XSize = 90;
                    this.YSize = 150;
                    this.attrs = properties.attrs || {};
                    if (!this.attrs.fill) {
                        this.attrs.fill = "white";
                        this.attrs.stroke = "white";
                    }
                    this.innerAttrs = properties.innerAttrs || {};
                    if (!this.innerAttrs.fill) {
                        this.innerAttrs.fill = "black";
                    }
                    // wrapper
                    this.setWrapper(this.paper.rect(this.position.x, this.position.y, this.XSize, this.YSize, 0).attr(this.attrs));
                    // inner
                    this.addInner(this.paper.circle(this.position.x + (this.XSize / 2), this.position.y + 15, 12).attr(this.innerAttrs));
                    this.addInner(this.paper.path("M" + (this.position.x + (this.XSize / 2)) + " " + (this.position.y + 15) + "L" + (this.position.x + (this.XSize / 2)) + " " + (this.position.y + 75)).attr(this.innerAttrs));
                    
                    this.addInner(this.paper.path("M" + (this.position.x + (this.XSize / 2)) + " " + (this.position.y + 30) + "L" + ((this.position.x + (this.XSize / 2)) - 10) + " " + (this.position.y + 55)).attr(this.innerAttrs));
                    this.addInner(this.paper.path("M" + (this.position.x + (this.XSize / 2)) + " " + (this.position.y + 30) + "L" + ((this.position.x + (this.XSize / 2)) + 10) + " " + (this.position.y + 55)).attr(this.innerAttrs));
                    
                    this.addInner(this.paper.path("M" + (this.position.x + (this.XSize / 2)) + " " + (this.position.y + 75) + "L" + ((this.position.x + (this.XSize / 2)) - 10) + " " + (this.position.y + 120)).attr(this.innerAttrs));
                    this.addInner(this.paper.path("M" + (this.position.x + (this.XSize / 2)) + " " + (this.position.y + 75) + "L" + ((this.position.x + (this.XSize / 2)) + 10) + " " + (this.position.y + 120)).attr(this.innerAttrs));
                    
                    this.addInner(this.paper.text(((this.position.x + (this.XSize / 2)) - 10), this.position.y + 130, properties.name).attr(this.innerAttrs));
                },
                zoom: function(){
                    this.inner[0].scale.apply(this.inner[0], arguments);
                }
            });
            
            uml.connectActorUseCase=function()
            {
            	uml.connecting=1;
            }
            
            /**
             * UML Use Cases Actor
             * @param raphael raphael paper
             * @param p point position
             * @param r radius
             * @param attrs shape SVG attributes
             */
            uml.Balloon = Element.extend({
                init: function(properties){
                    // options
                    this.position = properties.position || point(0, 0);
                    this.XSize = 50;
                    this.YSize = 20;
                    this.attrs = properties.attrs || {};
                    if (!this.attrs.fill) {
                        this.attrs.fill = "white";
                        this.attrs.stroke = "black";
                    }
                    this.innerAttrs = properties.innerAttrs || {};
                    if (!this.innerAttrs.fill) {
                        this.innerAttrs.fill = "black";
                    }
                    // wrapper
                    this.setWrapper(this.paper.ellipse(this.position.x, this.position.y, this.XSize, this.YSize).attr(this.attrs));
                    
                    this.addInner(this.paper.text(this.position.x - (this.XSize / 2) + 1, this.position.y + 1, properties.description).attr(this.innerAttrs));
                },
                zoom: function(){
                    this.inner[0].scale.apply(this.inner[0], arguments);
                }
            });
            
            var elements= [];
            function addActor(xa,ya,text){
                var s1 = uml.Actor.create({
                    position: {
                        x: xa,
                        y: ya
                    },
                    name: text
                
                }).toggleGhosting();
                elements.push(s1);
            }
            
            function addUseCase(xa,ya,text){
                var s2 = uml.Balloon.create({
                    position: {
                        x: xa,
                        y: ya
                    },
                    description: text
                }).toggleGhosting();
                elements.push(s2);
            }
            